{
    "cells": [
        {
            "cell_type": "code",
            "execution_count": null,
            "metadata": {},
            "outputs": [],
            "source": [
                "import numpy as np\n",
                "import matplotlib.pyplot as plt\n"
            ]
        },
        {
            "cell_type": "code",
            "execution_count": null,
            "metadata": {},
            "outputs": [],
            "source": [
                "#part a\n",
                "n = 400\n",
                "\n",
                "X = np.load(\"Xtrain.npy\")\n",
                "y = np.load(\"ytrain.npy\")\n",
                "\n",
                "def visualize_dataset(X, y):\n",
                "    plt.scatter(X[y < 0.0, 0], X[y < 0.0, 1])\n",
                "    plt.scatter(X[y > 0.0, 0], X[y > 0.0, 1])\n",
                "    plt.show()\n",
                "\n",
                "# TODO: visualize the dataset\n",
                "visualize_dataset(X, y)\n"
            ]
        },
        {
            "cell_type": "code",
            "execution_count": null,
            "metadata": {},
            "outputs": [],
            "source": [
                "# part b\n",
                "# TODO: solve the linear regression on the training data\n",
                "### start b1 ###\n",
                "\n",
                "### end b1 ###\n",
                "Xtest = np.load(\"Xtest.npy\")\n",
                "ytest = np.load(\"ytest.npy\")\n",
                "# TODO: report the classification accuracy on the test set\n",
                "### start b2 ###\n",
                "\n",
                "### end b2 ###\n"
            ]
        },
        {
            "cell_type": "code",
            "execution_count": null,
            "metadata": {},
            "outputs": [],
            "source": [
                "# part c\n",
                "# TODO: Create a matrix Phi_train with polynomial features from the training data\n",
                "# and solve the linear regression on the training data\n",
                "\n",
                "### start c1 ###\n",
                "\n",
                "### end c1 ###\n",
                "\n",
                "# TODO: Create a matrix Phi_test with polynomial features from the test data\n",
                "# and report the classification accuracy on the test set\n",
                "\n",
                "### start c2 ###\n",
                "\n",
                "### end c2 ###\n"
            ]
        },
        {
            "cell_type": "code",
            "execution_count": null,
            "metadata": {},
            "outputs": [],
            "source": [
                "# part d\n",
                "# TODO: Report the weight vector that was found in the feature space with the polyno-\n",
                "# mial features.\n",
                "\n",
                "\n",
                "### start d1 ###\n",
                "\n",
                "### end d1 ###\n"
            ]
        },
        {
            "cell_type": "code",
            "execution_count": null,
            "metadata": {},
            "outputs": [],
            "source": []
        }
    ],
    "metadata": {
        "kernelspec": {
            "display_name": "Python 3",
            "language": "python",
            "name": "python3"
        },
        "language_info": {
            "codemirror_mode": {
                "name": "ipython",
                "version": 3
            },
            "file_extension": ".py",
            "mimetype": "text/x-python",
            "name": "python",
            "nbconvert_exporter": "python",
            "pygments_lexer": "ipython3",
            "version": "3.8.5"
        }
    },
    "nbformat": 4,
    "nbformat_minor": 2
}